Thream/api

Licence MIT Contributor Covenant

Conventional Commits semantic-release

## 📜 About Thream's Application Programming Interface (API) to stay close with your friends and communities. It uses [Thream/file-uploads-api](https://github.com/Thream/file-uploads-api) [v1.1.5](https://github.com/Thream/file-uploads-api/releases/tag/v1.1.5). ## ⚙️ Getting Started ### Prerequisites - [Node.js](https://nodejs.org/) >= 16.0.0 - [npm](https://www.npmjs.com/) >= 8.0.0 - [PostgreSQL](https://www.postgresql.org/) ### Installation ```sh # Clone the repository git clone git@github.com:Thream/api.git # Go to the project root cd api # Configure environment variables cp .env.example .env # Install npm install npm run prisma:generate ``` You will need to configure the environment variables by creating an `.env` file at the root of the project (see `.env.example`). ### Local Development environment Recommended to use [VSCode: Remote development in Containers](https://code.visualstudio.com/docs/remote/containers-tutorial). #### Setup the database ```sh # Create a new user and database psql create database thream_database; create user thream_user with encrypted password 'password'; ALTER USER thream_user WITH SUPERUSER; ``` Replace `DATABASE_URL` inside `.env` with `postgresql://thream_user:password@localhost:5432/thream_database` ```sh # Run Prisma migrations npm run prisma:migrate:dev ``` #### Usage ```sh # Run API npm run dev # Run Prisma Studio npm run prisma:studio ``` ## 💡 Contributing Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake. The steps to contribute can be found in [CONTRIBUTING.md](./CONTRIBUTING.md). ## 📄 License [MIT](./LICENSE)