Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsleonb/post-article
A web app for managing article posts
https://github.com/itsleonb/post-article
gin golang mysql react rest-api typescript vite
Last synced: 17 days ago
JSON representation
A web app for managing article posts
- Host: GitHub
- URL: https://github.com/itsleonb/post-article
- Owner: itsLeonB
- Created: 2024-08-17T04:37:51.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-17T21:28:45.000Z (4 months ago)
- Last Synced: 2024-10-16T18:58:11.503Z (2 months ago)
- Topics: gin, golang, mysql, react, rest-api, typescript, vite
- Language: TypeScript
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Post Article
A web app for managing article posts.
API Documentation can be accessed through [Postman](https://documenter.getpostman.com/view/29785588/2sA3s9BnCK)
## Available Features
- Post new article
- List all articles
- Get an article
- Edit an article
- Delete an article## Prerequisites
This project is built using:
### Backend
- Go v1.19.13
- MySQL 9.0.1-1.el9
- Gin v1.10.0
- Go MySQL Driver v1.8.1### Frontend
- TypeScript
- React
- Vite## Installation
### Backend
1. Clone the project and change directory to backend/api.
```sh
cd backend/api
```2. Run these commands:
```sh
# tidy dependencies
go mod tidy# create env file from example
cp .env.example .env
```3. Change the values in `.env` to your own values. Set the `APP_ENV` value in `.env` to either `release` (for production use) or `debug` for development use.
4. Run the SQL files in `/backend/db` with your favorite DB connection driver to migrate the database and required tables.
5. Run the file `/backend/db/seed/seed.sql` with your favorite DB connection driver for seeding required data.
6. (optional) Run the file `/backend/db/seed/example.sql` with your favorite DB connection driver for seeding example data.
7. Serve the app with `go run .`
### Frontend
1. Clone the project and change directory to frontend.
```sh
cd frontend
```2. Install dependencies with npm
```sh
npm install
```3. Generate a new .env file
```sh
cp .env.example .env
```4. Change the VITE_BASE_URL value according to the backend `BASE_URL`
5. Start the server or build to static files
```sh
npm run dev # for running the server
# or
npm run build # for building the project
```