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

https://github.com/mayocream/pfn_coding

PFN Coding
https://github.com/mayocream/pfn_coding

Last synced: 2 months ago
JSON representation

PFN Coding

Awesome Lists containing this project

README

          

# RESTful API Server

## Description

PFN Coding Challenge (5)

HTTP RESTful API server that provides the following endpoints:

- `POST /signup`: Create a new user
- `GET /users/{user_id}`: Get user information
- `PATCH /users/{user_id}`: Update user information
- `POST /close`: Delete user

### Requirements

- [x] JSON Responses
- [x] RESTful API
- [x] Deployment on any cloud provider

### Bonus

- [x] Dockerfile
- [x] Kubernetes deployment manifests

## Implementation

As the challenge requires a RESTful API server, I implemented the server using Go with best practices in mind.

The RESTful API server is implemented in Go. The server uses the following libraries:

- uber/fx for dependency injection
- fiber for HTTP server
- ent for ORM
- validator for request validation

The account storage repository is implemented using ent ORM. It could be stored in any SQL database supported by ent, such as MySQL, PostgreSQL, SQLite, and CockroachDB.

The server is deployed on Google Cloud Run. The server uses in-memory SQLite for the database as it's for demonstration purposes only. **In production, you should use a real database.**