Backend of an application created to streamline and enhance the inventory processes for individuals and teams managing green areas.
$ docker compose up --build -d
.
├── Dockerfile
├── README.md
├── controllers
│ ├── investorsController.go
│ ├── locationsController.go
│ ├── officeController.go
│ ├── statusesController.go
│ └── usersController.go
├── docker-compose.yaml
├── go.mod
├── go.sum
├── initializers
│ ├── dbConnector.go
│ ├── dbSeeder.go
│ ├── dbSynchronizer.go
│ ├── envVariablesLoader.go
│ └── seeds
│ ├── offices.json
│ └── statuses.json
├── main.go
├── middleware
│ ├── handleCORS.go
│ └── requireAuth.go
├── models
│ ├── addressModel.go
│ ├── applicationModel.go
│ ├── authModel.go
│ ├── commonModel.go
│ ├── investorModel.go
│ ├── locationModel.go
│ ├── noteModel.go
│ ├── officeModel.go
│ ├── statusModel.go
│ └── userModel.go
├── test
├── tmp
└── validators
└── usersValidator.go
Auth
POST /register
{
email: string,
password: string
}
POST /login
{
email: string,
password: string
}
GET /validate
DELETE /users
Statuses
GET /statuses
POST /statuses
{
name: string;
}
PUT /statuses/:id
{
name: string;
}
DELETE /statuses/:id
Investor
GET /investors
GET /investors/:id
POST /investors
{
name: string,
contactPerson: string,
phone: string,
email: string,
nip: string,
regon: string,
address: {
city: string,
street: string,
number: string,
zipCode: string
}
}
PUT /investors/:id
{
name: string,
contactPerson: string,
phone: string,
email: string,
nip: string,
regon: string,
address: {
city: string,
street: string,
number: string,
zipCode: string
}
}
DELETE /investors/:id
Offices
GET /offices
GET /offices/:id
POST /offices
{
name: string,
address: {
city: string,
street: string,
number: string,
zipCode: string
}
}
PUT /offices/:id
{
name: string,
address: {
city: string,
street: string,
number: string,
zipCode: string
}
}
DELETE /offices/:id
Locations
GET /locations
GET /locations/:id
POST /locations
{
name: string,
issueDate: string, // ISO 8601
inspectionDate: string, // ISO 8601
deforestationDate: string, // ISO 8601
plantingDate: string, // ISO 8601
deforestationDone: boolean,
plantingDone: boolean,
address: {
city: string,
street: string,
number: string,
zipCode: string
},
statusId: int,
investorId: int,
}
PUT /locations/:id
{
name: string,
issueDate: string, // ISO 8601
inspectionDate: string, // ISO 8601
deforestationDate: string, // ISO 8601
plantingDate: string, // ISO 8601
deforestationDone: boolean,
plantingDone: boolean,
address: {
city: string,
street: string,
number: string,
zipCode: string
},
statusId: int,
investorId: int,
}
DELETE /locations/:id