Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaay7/dpdzero-challenge
dpdzero hiring challenge to create REST APIs
https://github.com/jaay7/dpdzero-challenge
expressjs mysql nodejs prisma prisma-client railway
Last synced: about 18 hours ago
JSON representation
dpdzero hiring challenge to create REST APIs
- Host: GitHub
- URL: https://github.com/jaay7/dpdzero-challenge
- Owner: Jaay7
- License: mit
- Created: 2023-08-04T03:22:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-05T02:35:49.000Z (over 1 year ago)
- Last Synced: 2024-04-24T11:03:59.748Z (7 months ago)
- Topics: expressjs, mysql, nodejs, prisma, prisma-client, railway
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dpdzero-challenge
dpdzero hiring challenge to create REST APIs## Technologies
- [Node.js](https://nodejs.org/en) - An open-source, cross-platform JavaScript runtime environment.
- [Express.js](https://expressjs.com/) - Fast, unopinionated, minimalist web framework for Node.js
- MySQL - [Railway](https://railway.app/)
- [Prisma](https://www.prisma.io/) - ORM for Node.js
- [Docker](https://www.docker.com/get-started/) - Develop faster. Run anywhere.## Instructions
#### How to setup
- Clone the repository
```sh
https://github.com/Jaay7/dpdzero-challenge.git
```- Installing necessary packages
```sh
npm install
```- Create a new MySQL project on [Railway](https://railway.app/)
- Create ```.env``` file with the following variables
```
DATABASE_URL="" # Paste the MySQL URL from the Railway project.
APP_SECRET=""
```- Now use the Prisma Migrate command to create the tables
```sh
npx prisma migrate dev --name init
```#### How to run
- Run command
```sh
npm run dev
```#### How to setup using Docker
- Install Docker on your machine [Guide](https://docs.docker.com/desktop/)
- Start the docker container
```sh
docker-compose up
```
These two containers will start running
- Now we have to modify a few things
1. Open the ```prisma-mysql-api``` container and go to the terminal
2. Run the Prisma Migrate command
```sh
npx prisma migrate dev --name init
```3. Restart the container