Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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

dock1

- 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
```
dock2

3. Restart the container

dock3