https://github.com/mayocream/pfn_coding
PFN Coding
https://github.com/mayocream/pfn_coding
Last synced: 2 months ago
JSON representation
PFN Coding
- Host: GitHub
- URL: https://github.com/mayocream/pfn_coding
- Owner: mayocream
- Created: 2024-10-28T08:31:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T14:00:55.000Z (over 1 year ago)
- Last Synced: 2025-10-11T17:18:36.487Z (8 months ago)
- Language: Go
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.**